﻿Public Class bookedOnlineForm
    Dim check As Boolean = False

    Private Sub cancelBtn_Click(sender As System.Object, e As System.EventArgs) Handles cancelBtn.Click
        Me.Hide()
    End Sub

    Private Sub bookedOnlineForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        logoPic.Location = New System.Drawing.Point(((bookedOnlinePanel.Width / 2) - (logoPic.Width / 2)), 3)
        bookedOnlinePanel.Location = New System.Drawing.Point(((Me.Width / 2) - (bookedOnlinePanel.Width / 2)), ((Me.Height / 2) - (bookedOnlinePanel.Height / 2)))
    End Sub

    Private Sub proceedBtn_Click(sender As System.Object, e As System.EventArgs) Handles proceedBtn.Click
        Dim checkCode As New checkCode
        If (bookingCodeTxt.Text.StartsWith(" ") Or bookingCodeTxt.Text = "") Then
            MessageBox.Show("A code must be entered")
        Else
            check = checkCode.checkOnlineCode()
            If (check = True) Then
                roomForm.setCond("online")
                roomForm.Show()
            Else
                MessageBox.Show("Booking code does not exist")
            End If
        End If
    End Sub
End Class